package com.mf.ergate.dao.auth.impl;

import com.mf.ergate.dao.GenericDao;
import com.mf.ergate.dao.auth.ResourceInfoDao;
import com.mf.ergate.domain.model.auth.ResourceInfoEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 资源信息Dao层实现类
 * User: zhaoming
 * DateTime: 2018-10-10
 * To change this template use File | Settings | File Templates.
 **/
@Repository
public class ResourceInfoDaoImpl extends GenericDao<ResourceInfoEntity> implements ResourceInfoDao {

    private Logger logger = LoggerFactory.getLogger(getClass());

    private static final String selectByAppTypeCodeAndUserNo = "selectByAppTypeCodeAndUserNo";  //根据应用类型编码与用户编号查询

    /**
     * 根据应用类型编码与用户编号查询
     * @param appTypeCode 应用类型编号
     * @param userNo 用户编号
     * @return 资源信息列表
     */
    public List<ResourceInfoEntity> selectByAppTypeCodeAndUserNo(String appTypeCode, String userNo){
        Map<String, String> map = new HashMap<>();
        map.put("appTypeCode", appTypeCode);
        map.put("userNo", userNo);
        return this.getSqlSession().selectList(this.getStatement(selectByAppTypeCodeAndUserNo), map);
    }
}
